//
//  RealAuthViewController.m
//  Kjs-iOS
//
//  Created by 江伟 on 16/6/29.
//  Copyright © 2016年 jmhz. All rights reserved.
//

#import "RealAuthViewController.h"
#import "AuthDetalViewController.h"
#import "OrgAuthDetailViewController.h"
@interface RealAuthViewController ()
@end

@implementation RealAuthViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.navigationItem setTitle:@"实名认证"];
    //虚线边框
    CAShapeLayer *pAuthBorderLayer = [CAShapeLayer layer];
    pAuthBorderLayer.bounds = CGRectMake(0, 0, 200, 105);
    pAuthBorderLayer.position = CGPointMake(CGRectGetMidX(self.pAuthView.bounds), CGRectGetMidY(self.pAuthView.bounds));
    pAuthBorderLayer.path = [UIBezierPath bezierPathWithRect:pAuthBorderLayer.bounds].CGPath;
    pAuthBorderLayer.lineWidth = 1. / [[UIScreen mainScreen] scale];
    pAuthBorderLayer.lineDashPattern = @[@8, @8];
    pAuthBorderLayer.fillColor = [UIColor clearColor].CGColor;
    pAuthBorderLayer.strokeColor = [UIColor colorWithRed:88/255.0f green:188/255.0f blue:247/255.0f alpha:1].CGColor;
    CAShapeLayer *oAuthBorderLayer = [CAShapeLayer layer];
    oAuthBorderLayer.bounds = CGRectMake(0, 0, 200, 105);
    oAuthBorderLayer.position = CGPointMake(CGRectGetMidX(self.pAuthView.bounds), CGRectGetMidY(self.pAuthView.bounds));
    oAuthBorderLayer.path = [UIBezierPath bezierPathWithRect:oAuthBorderLayer.bounds].CGPath;
    oAuthBorderLayer.lineWidth = 1. / [[UIScreen mainScreen] scale];
    oAuthBorderLayer.lineDashPattern = @[@8, @8];
    oAuthBorderLayer.fillColor = [UIColor clearColor].CGColor;
    oAuthBorderLayer.strokeColor = [UIColor colorWithRed:88/255.0f green:188/255.0f blue:247/255.0f alpha:1].CGColor;
    [self.pAuthView.layer addSublayer:pAuthBorderLayer];
    [self.oAuthView.layer addSublayer:oAuthBorderLayer];
    //跳转到实名认证详情界面－个人
    UITapGestureRecognizer *goPRealAuth = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(goPRealAuthDetail)];
    self.pAuthView.userInteractionEnabled = YES;
    [self.pAuthView addGestureRecognizer:goPRealAuth];
    //跳转到实名认证详情界面－机构
    UITapGestureRecognizer *goORealAuth = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(goORealAuthDetail)];
    self.oAuthView.userInteractionEnabled = YES;
    [self.oAuthView  addGestureRecognizer:goORealAuth];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - custom method
- (void)goPRealAuthDetail
{
    NSLog(@"实名认证界面");
    AuthDetalViewController *realAuthVC = [[UIStoryboard storyboardWithName:@"Seconed" bundle:nil] instantiateViewControllerWithIdentifier:@"AuthDetalViewController"];
    realAuthVC.authSuccess = ^(){
        [self dismiss:YES];
    };
    [self displayViewController:realAuthVC];
    
    
}
- (void)goORealAuthDetail
{
    NSLog(@"实名认证界面");
    OrgAuthDetailViewController *realAuthVC = [[UIStoryboard storyboardWithName:@"Seconed" bundle:nil] instantiateViewControllerWithIdentifier:@"OrgAuthDetailViewController"];
    realAuthVC.authSuccess = ^(){
        [self dismiss:YES];
    };
    [self displayViewController:realAuthVC];
    
    
    
}


@end
